package is.server.controller.session.remote.command;

import is.common.interfaces.Command;
import is.common.util.ObjectStreamer;
import is.server.Main;
import org.w3c.dom.Document;

import java.io.IOException;

/**
 * @author aspr0
 *         Date: 30.05.12
 *         Time: 3:41
 */
public class ConcatCommand implements Command
{
    private ObjectStreamer objectStreamer;

    public ConcatCommand(ObjectStreamer objectStreamer)
    {
        this.objectStreamer = objectStreamer;
    }

    @Override
    public void execute()
    {
        Document dbDoc = Main.getController().getModel().getDbDoc();

        try
        {
            objectStreamer.transmitObject(dbDoc);
        }
        catch (IOException e)
        {
            e.printStackTrace();
        }
    }
}
